import request from '@/utils/request'

// 工作台 首页 待我处理
export function listMainPageMe(query) {
    return request({
        url: '/ec/flow/listMainPageMe',
        method: 'get',
        params: query
    })
}


// 合同签署流程列表 根据参数
export function listContractSignByParam(query) {
    return request({
        url: '/ec/flow/listContractSignByParam',
        method: 'get',
        params: query
    })
}

// 待我签署
export function listContractSignMine(query) {
    return request({
        url: '/ec/flow/listMe',
        method: 'get',
        params: query
    })
}
// 待我方签署
export function listContractSignOur(query) {
    return request({
        url: '/ec/flow/listOur',
        method: 'get',
        params: query
    })
}

//待他方签署
export function listContractSignOther(query) {
    return request({
        url: '/ec/flow/listOther',
        method: 'get',
        params: query
    })
}

//全部签署完成
export function listContractSignAllSuccess(query) {
    return request({
        url: '/ec/flow/listAllSuccess',
        method: 'get',
        params: query
    })
}

// 已撤销合同
export function listContractSignBack(query) {
    return request({
        url: '/ec/flow/listBack',
        method: 'get',
        params: query
    })
}

// 抄送合同
export function listContractSignCopy(query) {
    return request({
        url: '/ec/copy/list',
        method: 'get',
        params: query
    })
}

// 根据合同id 查询 抄送合同
export function listContractSignCopyByContractId(id) {
    return request({
        url: '/ec/copy/list/' + id,
        method: 'get',
    })
}


// 查询合同签署流程详细
export function getContractSignMine(id) {
    return request({
        url: '/ec/flow/' + id,
        method: 'get'
    })
}

// 查询合同签署流程详细 根据加密的rsa查询数据
export function getContractSignMineByRsa(id) {
    return request({
        url: '/ec/flow/rsa/' + id,
        method: 'get'
    })
}

// 单份签署合同
export function signOneContract(data) {
    return request({
        url: '/ec/flow/signOneContract',
        method: 'post',
        data: data
    })
}

// 新增合同签署流程
export function addContractSignMine(data) {
    return request({
        url: '/ec/flow',
        method: 'post',
        data: data
    })
}

// 修改合同签署流程
export function updateContractSignMine(data) {
    return request({
        url: '/ec/flow',
        method: 'put',
        data: data
    })
}

// 删除合同签署流程
export function delContractSignMine(id) {
    return request({
        url: '/ec/flow/' + id,
        method: 'delete'
    })
}

// 签署方信息设置 签署流程定义 查询
export function signFlowSet() {
    return request({
        url: '/ec/flow/signFlowSet',
        method: 'get',
    })
}

// 接收方经办人没盖章权限 进行转签
export function transferFlow(data) {
    return request({
        url: '/ec/flow/transferFlow',
        method: 'post',
        data: data
    })
}

// 生成模板合同
export function contractSignAutoAdd(query) {
    return request({
        url: '/ec/flow/autoAdd',
        method: 'get',
        params: query
    })
}


